package com.qf.controller;

import com.qf.bean.Student;
import com.qf.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * 2019/12/4
 * Administrator
 * springboot1204
 * 面向对象面向君  不负代码不负卿
 */
@Controller
public class ThymeleafController {

    @Autowired
    private StudentService studentService;
    @RequestMapping("/getallstudents")
    public String  getstus(ModelMap map){
        List<Student> students = studentService.findstudents();
        map.addAttribute("stus",students);
        return "showthymeleaf";
    }


}
